package com.fw.ui.view.profile;

import static org.springframework.beans.factory.config.BeanDefinition.SCOPE_PROTOTYPE;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;

import com.fw.service.bean.EntryBean;
import com.fw.service.bean.SearchCriteriaBean;
import com.fw.service.bean.SearchResultBean;
import com.fw.service.serviceprofile.bean.SearchServiceProfileBean;
import com.fw.service.serviceprofile.bean.ServiceProfileBean;
import com.fw.ui.bao.MasterDataBAO;
import com.fw.ui.bao.MessageBAO;
import com.fw.ui.bao.PropertyBAO;
import com.fw.ui.bao.ServiceProfileBAO;
import com.fw.ui.bean.serviceprofile.SearchServiceProfileTableItemBean;
import com.fw.ui.core.ViewDescription;
import com.fw.ui.util.VaadinApplicationObjectSupport;
import com.fw.ui.view.AbstractView;
import com.fw.ui.view.common.SortingTablePanel;
import com.fw.ui.view.common.TablePanel;
import com.fw.ui.view.common.util.TableHeaderProperty;
import com.fw.ui.view.profile.service.event.SearchServiceProfileClearButtonClickListener;
import com.fw.ui.view.profile.service.event.SearchServiceProfileExportButtonClickListener;
import com.fw.ui.view.profile.service.event.SearchServiceProfileNewButtonClickListener;
import com.fw.ui.view.profile.service.event.SearchServiceProfileSearchButtonClickListener;
import com.fw.ui.view.profile.service.event.SearchServiceProfileTableDeleteButtonClickListener;
import com.fw.ui.view.profile.service.event.SearchServiceProfileTableEditButtonClickListener;
import com.fw.ui.view.profile.service.event.SearchServiceProfileTablePageButtonClickListener;
import com.fw.ui.view.profile.service.event.SearchServiceProfileTableSizeValueChangeListener;
import com.fw.ui.view.profile.service.event.SearchServiceProfileTableSortButtonClickListener;
import com.fw.ui.view.profile.service.event.SearchServiceProfileTableViewButtonClickListener;
import com.fw.util.StringUtils;
import com.vaadin.data.util.BeanItem;
import com.vaadin.shared.ui.combobox.FilteringMode;
import com.vaadin.shared.ui.datefield.Resolution;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.PopupDateField;
import com.vaadin.ui.Table.Align;
import com.vaadin.ui.VerticalLayout;

@org.springframework.stereotype.Component
@Scope(SCOPE_PROTOTYPE)
@ViewDescription(name = "profile-service-search", path = "/profile/service/search")
public class SearchServiceProfileView extends AbstractView {

    public static final String SERVICE_TYPE_CASH = "ServiceProfile.SERVICE_TYPE_CASH";

    private static final long serialVersionUID = 1L;

    @Autowired
    protected transient VaadinApplicationObjectSupport app;

    @Autowired
    private MasterDataBAO masterDataBAO;
    @Autowired
    private MessageBAO messageBAO;
    @Autowired
    private PropertyBAO propertyBAO;
    @Autowired
    private ServiceProfileBAO serviceProfileBAO;

    private Map<String, String> statusMap = new HashMap<String, String>();
    private Map<String, String> serviceTypeMap = new HashMap<String, String>();
    private Map<String, String> merchantServiceTypeMap = new HashMap<String, String>();
    private SearchServiceProfileBean searchServiceProfileBean = new SearchServiceProfileBean();
    private SearchCriteriaBean<SearchServiceProfileBean> searchCriteriaBean = new SearchCriteriaBean<SearchServiceProfileBean>();

    @Autowired
    private SearchServiceProfileExportButtonClickListener searchServiceProfileExportButtonClickListener;
    @Autowired
    private SearchServiceProfileClearButtonClickListener searchServiceProfileClearButtonClickListener;
    @Autowired
    private SearchServiceProfileNewButtonClickListener searchServiceProfileNewButtonClickListener;
    @Autowired
    private SearchServiceProfileSearchButtonClickListener searchServiceProfileSearchButtonClickListener;
    @Autowired
    private SearchServiceProfileTableDeleteButtonClickListener searchServiceProfileTableDeleteButtonClickListener;
    @Autowired
    private SearchServiceProfileTableEditButtonClickListener searchServiceProfileTableEditButtonClickListener;
    @Autowired
    private SearchServiceProfileTablePageButtonClickListener searchServiceProfileTablePageButtonClickListener;
    @Autowired
    private SearchServiceProfileTableSizeValueChangeListener searchServiceProfileTableSizeValueChangeListener;
    @Autowired
    private SearchServiceProfileTableSortButtonClickListener searchServiceProfileTableSortButtonClickListener;
    @Autowired
    private SearchServiceProfileTableViewButtonClickListener searchServiceProfileTableViewButtonClickListener;

    /**
     * COMPONENT
     */
    private Panel searchServiceProfilePanel = new Panel();

    @Autowired
    protected TablePanel tablePanel;
    @Autowired
    protected SortingTablePanel sortingTablePanel;

    private Label lblServiceId = new Label();
    private Label lblMerchantId = new Label();
    private Label lblMerchantName = new Label();

    private Label lblCompanyName = new Label();
    private Label lblProjectContact = new Label();

    private Label lblBankGuaranteeExpireDate = new Label();
    private Label lblBankGuaranteeExpireDateFrom = new Label();
    private Label lblBankGuaranteeExpireDateTo = new Label();
    private Label lblLauchedDate = new Label();
    private Label lblLauchedDateFrom = new Label();
    private Label lblLauchedDateTo = new Label();

    private Label lblMdr = new Label();
    private Label lblServiceFee = new Label();
    private Label lblStatus = new Label();

    private Label lblServiceType = new Label();
    private Label lblHost = new Label();

    private ComboBox cbbServiceId = new ComboBox();
    private ComboBox cbbMerchantId = new ComboBox();
    private ComboBox cbbMerchantName = new ComboBox();

    private ComboBox cbbCompanyName = new ComboBox();
    private ComboBox cbbProjectContact = new ComboBox();
    private CheckBox cbHideServiceTest = new CheckBox();

    private PopupDateField pdfBankGuaranteeExpireDateFrom = new PopupDateField();
    private PopupDateField pdfBankGuaranteeExpireDateTo = new PopupDateField();
    private PopupDateField pdfLaunchedDateFrom = new PopupDateField();
    private PopupDateField pdfLaunchedDateTo = new PopupDateField();

    private ComboBox cbbMdr = new ComboBox();
    private ComboBox cbbServiceFee = new ComboBox();
    private ComboBox cbbStatus = new ComboBox();

    private ComboBox cbbServiceType = new ComboBox();
    private ComboBox cbbHost = new ComboBox();

    private Button btnSearch = new Button();
    private Button btnNew = new Button();
    private Button btnExport = new Button();
    private Button btnClear = new Button();

    private TableHeaderProperty hMerchantId = new TableHeaderProperty();
    private TableHeaderProperty hMerchantName = new TableHeaderProperty();
    private TableHeaderProperty hCompanyName = new TableHeaderProperty();
    private TableHeaderProperty hMerchantServiceType = new TableHeaderProperty();
    private TableHeaderProperty hMerchantUrl = new TableHeaderProperty();
    private TableHeaderProperty hServiceId = new TableHeaderProperty();
    private TableHeaderProperty hContactPerson = new TableHeaderProperty();
    private TableHeaderProperty hHost = new TableHeaderProperty();
    private TableHeaderProperty hServiceType = new TableHeaderProperty();
    private TableHeaderProperty hMdr = new TableHeaderProperty();
    private TableHeaderProperty hServiceFee = new TableHeaderProperty();
    private TableHeaderProperty hBankGuaranteeExpireDate = new TableHeaderProperty();
    private TableHeaderProperty hLaunchedDate = new TableHeaderProperty();
    private TableHeaderProperty hStatus = new TableHeaderProperty();
    private TableHeaderProperty hCreateDate = new TableHeaderProperty();
    private TableHeaderProperty hLastUpdateDate = new TableHeaderProperty();
    private TableHeaderProperty hCommand = new TableHeaderProperty();

    private List<Button> tableViewButtons = new ArrayList<Button>();
    private List<Button> tableEditButtons = new ArrayList<Button>();
    private List<Button> tableDeleteButtons = new ArrayList<Button>();

    @Override
    public void updateStrings() {
	this.searchServiceProfilePanel.setCaption(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.title"));

	this.lblServiceId.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.serviceId"));
	this.lblMerchantId.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.merchantId"));
	this.lblMerchantName.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.merchantName"));

	this.lblCompanyName.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.companyName"));
	this.lblProjectContact.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.projectContact"));

	this.lblBankGuaranteeExpireDate.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.bankGuaranteeExpireDate"));
	this.lblBankGuaranteeExpireDateFrom.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.bankGuaranteeExpireDate.from"));
	this.lblBankGuaranteeExpireDateTo.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.bankGuaranteeExpireDate.to"));
	this.lblLauchedDate.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.lauchedDate"));
	this.lblLauchedDateFrom.setValue(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.lauchedDate.from"));
	this.lblLauchedDateTo.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.lauchedDate.to"));

	this.lblMdr.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.mdr"));
	this.lblServiceFee.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.serviceFee"));
	this.lblStatus.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.status"));

	this.lblServiceType.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.serviceType"));
	this.lblHost.setValue(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.host"));

	this.cbbServiceId.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.serviceId"));
	this.cbbMerchantId.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.merchantId"));
	this.cbbMerchantName.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.merchantName"));
	this.cbbCompanyName.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.companyName"));
	this.cbbProjectContact.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.projectContact"));
	this.cbHideServiceTest.setCaption(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.label.hideServiceTest"));

	this.pdfBankGuaranteeExpireDateFrom.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.bankGuaranteeExpireDate.from"));
	this.pdfBankGuaranteeExpireDateTo.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.bankGuaranteeExpireDate.to"));
	this.pdfLaunchedDateFrom.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.launchedDate.from"));
	this.pdfLaunchedDateTo.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.launchedDate.to"));

	this.cbbMdr.setInputPrompt(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.mdr"));
	this.cbbServiceFee.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.serviceFee"));
	this.cbbStatus.setInputPrompt(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.status"));

	this.cbbServiceType.setInputPrompt(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.serviceType"));
	this.cbbHost.setInputPrompt(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.inputprompt.host"));

	this.btnSearch.setCaption(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.button.search"));
	this.btnNew.setCaption(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.button.new"));
	this.btnExport.setCaption(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.button.export"));
	this.btnClear.setCaption(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.button.clear"));

	this.hMerchantId.setColumnName(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.merchantId"));
	this.hMerchantName.setColumnName(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.merchantName"));
	this.hCompanyName.setColumnName(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.companyName"));
	this.hMerchantServiceType.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.merchantServiceType"));
	this.hMerchantUrl.setColumnName(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.merchantUrl"));
	this.hServiceId.setColumnName(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.serviceId"));
	this.hContactPerson.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.contactPerson"));
	this.hHost.setColumnName(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.host"));
	this.hServiceType.setColumnName(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.serviceType"));
	this.hMdr.setColumnName(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.mdr"));
	this.hServiceFee.setColumnName(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.serviceFee"));
	this.hBankGuaranteeExpireDate.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.bankGuaranteeExpireDate"));
	this.hLaunchedDate.setColumnName(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.launchedDate"));
	this.hStatus.setColumnName(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.status"));
	this.hCreateDate.setColumnName(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.createDate"));
	this.hLastUpdateDate.setColumnName(this.messageBAO
		.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.lastUpdateDate"));
	this.hCommand.setColumnName(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.header.command"));

	tablePanel.setTableColumnHeader(this.hMerchantId.getColumnId(), this.hMerchantId.getColumnName());
	tablePanel.setTableColumnHeader(this.hMerchantName.getColumnId(), this.hMerchantName.getColumnName());
	tablePanel.setTableColumnHeader(this.hCompanyName.getColumnId(), this.hCompanyName.getColumnName());
	tablePanel.setTableColumnHeader(this.hMerchantServiceType.getColumnId(), this.hMerchantServiceType.getColumnName());
	tablePanel.setTableColumnHeader(this.hMerchantUrl.getColumnId(), this.hMerchantUrl.getColumnName());
	tablePanel.setTableColumnHeader(this.hServiceId.getColumnId(), this.hServiceId.getColumnName());
	tablePanel.setTableColumnHeader(this.hContactPerson.getColumnId(), this.hContactPerson.getColumnName());
	tablePanel.setTableColumnHeader(this.hHost.getColumnId(), this.hHost.getColumnName());
	tablePanel.setTableColumnHeader(this.hServiceType.getColumnId(), this.hServiceType.getColumnName());
	tablePanel.setTableColumnHeader(this.hMdr.getColumnId(), this.hMdr.getColumnName());
	tablePanel.setTableColumnHeader(this.hServiceFee.getColumnId(), this.hServiceFee.getColumnName());
	tablePanel.setTableColumnHeader(this.hBankGuaranteeExpireDate.getColumnId(), this.hBankGuaranteeExpireDate.getColumnName());
	tablePanel.setTableColumnHeader(this.hLaunchedDate.getColumnId(), this.hLaunchedDate.getColumnName());
	tablePanel.setTableColumnHeader(this.hStatus.getColumnId(), this.hStatus.getColumnName());
	tablePanel.setTableColumnHeader(this.hCreateDate.getColumnId(), this.hCreateDate.getColumnName());
	tablePanel.setTableColumnHeader(this.hLastUpdateDate.getColumnId(), this.hLastUpdateDate.getColumnName());
	tablePanel.setTableColumnHeader(this.hCommand.getColumnId(), this.hCommand.getColumnName());

	if (tableViewButtons != null && !tableViewButtons.isEmpty()) {
	    for (Button button : tableViewButtons) {
		button.setCaption(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.button.table.view"));
	    }
	}

	if (tableEditButtons != null && !tableEditButtons.isEmpty()) {
	    for (Button button : tableEditButtons) {
		button.setCaption(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.button.table.edit"));
	    }
	}

	if (tableDeleteButtons != null && !tableDeleteButtons.isEmpty()) {
	    for (Button button : tableDeleteButtons) {
		button.setCaption(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.button.table.delete"));
	    }
	}
    }

    @Override
    public void init() {

	this.setSizeFull();

	this.searchServiceProfilePanel.setSizeFull();
	this.searchServiceProfilePanel.setId("searchServiceProfilePanel");

	lblServiceId.setWidth("120px");
	lblMerchantId.setWidth("120px");
	lblMerchantName.setWidth("120px");

	lblCompanyName.setWidth("120px");
	lblProjectContact.setWidth("120px");
	cbHideServiceTest.setWidth("282px");

	lblBankGuaranteeExpireDate.setWidth("150px");
	lblBankGuaranteeExpireDateTo.setWidth("120px");
	lblLauchedDate.setWidth("150px");
	lblLauchedDateTo.setWidth("120px");

	lblMdr.setWidth("120px");
	lblServiceFee.setWidth("120px");
	lblStatus.setWidth("120px");

	lblServiceType.setWidth("230px");
	lblHost.setWidth("120px");

	cbbServiceId.setWidth("150px");
	cbbMerchantId.setWidth("150px");
	cbbMerchantName.setWidth("150px");

	cbbCompanyName.setWidth("150px");
	cbbProjectContact.setWidth("150px");

	pdfBankGuaranteeExpireDateFrom.setWidth("150px");
	pdfBankGuaranteeExpireDateTo.setWidth("150px");
	pdfLaunchedDateFrom.setWidth("150px");
	pdfLaunchedDateTo.setWidth("150px");

	cbbMdr.setWidth("150px");
	cbbServiceFee.setWidth("150px");
	cbbStatus.setWidth("150px");

	cbbServiceType.setWidth("150px");
	cbbHost.setWidth("150px");

	this.cbbServiceId.setNewItemsAllowed(true);
	this.cbbServiceId.setFilteringMode(FilteringMode.STARTSWITH);
	this.cbbMerchantId.setNewItemsAllowed(true);
	this.cbbMerchantId.setFilteringMode(FilteringMode.STARTSWITH);
	this.cbbMerchantName.setNewItemsAllowed(true);
	this.cbbMerchantName.setFilteringMode(FilteringMode.STARTSWITH);

	this.cbbCompanyName.setNewItemsAllowed(true);
	this.cbbCompanyName.setFilteringMode(FilteringMode.STARTSWITH);
	this.cbbProjectContact.setNewItemsAllowed(true);
	this.cbbProjectContact.setFilteringMode(FilteringMode.STARTSWITH);

	this.cbbMdr.setNewItemsAllowed(true);
	this.cbbMdr.setFilteringMode(FilteringMode.STARTSWITH);
	this.cbbServiceFee.setNewItemsAllowed(true);
	this.cbbServiceFee.setFilteringMode(FilteringMode.STARTSWITH);

	this.cbbStatus.setNewItemsAllowed(false);
	this.cbbStatus.setTextInputAllowed(false);
	this.cbbServiceType.setNewItemsAllowed(false);
	this.cbbServiceType.setTextInputAllowed(false);
	this.cbbHost.setNewItemsAllowed(false);
	this.cbbHost.setTextInputAllowed(false);

	this.pdfLaunchedDateFrom.setDateFormat(this.propertyBAO
		.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.format.date"));
	this.pdfLaunchedDateTo.setDateFormat(this.propertyBAO
		.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.format.date"));
	this.pdfBankGuaranteeExpireDateFrom.setDateFormat(this.propertyBAO
		.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.format.monthYear"));
	this.pdfBankGuaranteeExpireDateTo.setDateFormat(this.propertyBAO
		.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.format.monthYear"));

	this.pdfBankGuaranteeExpireDateFrom.setResolution(Resolution.MONTH);
	this.pdfBankGuaranteeExpireDateFrom.setInvalidAllowed(false);
	this.pdfBankGuaranteeExpireDateTo.setResolution(Resolution.MONTH);
	this.pdfBankGuaranteeExpireDateTo.setInvalidAllowed(false);
	this.pdfLaunchedDateFrom.setInvalidAllowed(false);
	this.pdfLaunchedDateTo.setInvalidAllowed(false);

	this.btnSearch.addStyleName("button-blue");
	this.btnNew.addStyleName("button-blue");
	this.btnExport.addStyleName("button-blue");
	this.btnClear.addStyleName("button-green");

	this.btnSearch.setDisableOnClick(true);
	this.btnNew.setDisableOnClick(true);
	this.btnExport.setDisableOnClick(true);
	this.btnClear.setDisableOnClick(true);

	this.btnSearch.setWidth("70px");
	this.btnNew.setWidth("70px");
	this.btnExport.setWidth("70px");
	this.btnClear.setWidth("70px");

	this.hMerchantId.setColumnId("merchantId");
	this.hMerchantId.setType(String.class);
	this.hMerchantId.setAlignment(Align.CENTER);
	this.hMerchantId.setDefaultValue(null);
	this.hMerchantId.setIconResource(null);
	this.hMerchantId.setWidth(80);
	this.hMerchantId.setOrder(1);

	this.hMerchantName.setColumnId("merchantName");
	this.hMerchantName.setType(String.class);
	this.hMerchantName.setAlignment(Align.LEFT);
	this.hMerchantName.setDefaultValue(null);
	this.hMerchantName.setIconResource(null);
	this.hMerchantName.setWidth(150);
	this.hMerchantName.setOrder(2);

	this.hCompanyName.setColumnId("companyName");
	this.hCompanyName.setType(String.class);
	this.hCompanyName.setAlignment(Align.LEFT);
	this.hCompanyName.setDefaultValue(null);
	this.hCompanyName.setIconResource(null);
	this.hCompanyName.setWidth(150);
	this.hCompanyName.setOrder(3);

	this.hMerchantServiceType.setColumnId("merchantServiceType");
	this.hMerchantServiceType.setType(String.class);
	this.hMerchantServiceType.setAlignment(Align.LEFT);
	this.hMerchantServiceType.setDefaultValue(null);
	this.hMerchantServiceType.setIconResource(null);
	this.hMerchantServiceType.setWidth(150);
	this.hMerchantServiceType.setOrder(4);

	this.hMerchantUrl.setColumnId("merchantUrl");
	this.hMerchantUrl.setType(String.class);
	this.hMerchantUrl.setAlignment(Align.LEFT);
	this.hMerchantUrl.setDefaultValue(null);
	this.hMerchantUrl.setIconResource(null);
	this.hMerchantUrl.setWidth(150);
	this.hMerchantUrl.setOrder(5);

	this.hServiceId.setColumnId("serviceId");
	this.hServiceId.setType(String.class);
	this.hServiceId.setAlignment(Align.CENTER);
	this.hServiceId.setDefaultValue(null);
	this.hServiceId.setIconResource(null);
	this.hServiceId.setWidth(80);
	this.hServiceId.setOrder(6);

	this.hContactPerson.setColumnId("contactPerson");
	this.hContactPerson.setType(String.class);
	this.hContactPerson.setAlignment(Align.LEFT);
	this.hContactPerson.setDefaultValue(null);
	this.hContactPerson.setIconResource(null);
	this.hContactPerson.setWidth(100);
	this.hContactPerson.setOrder(7);

	this.hHost.setColumnId("host");
	this.hHost.setType(String.class);
	this.hHost.setAlignment(Align.CENTER);
	this.hHost.setDefaultValue(null);
	this.hHost.setIconResource(null);
	this.hHost.setWidth(100);
	this.hHost.setOrder(8);

	this.hServiceType.setColumnId("serviceType");
	this.hServiceType.setType(String.class);
	this.hServiceType.setAlignment(Align.CENTER);
	this.hServiceType.setDefaultValue(null);
	this.hServiceType.setIconResource(null);
	this.hServiceType.setWidth(100);
	this.hServiceType.setOrder(9);

	this.hMdr.setColumnId("mdr");
	this.hMdr.setType(String.class);
	this.hMdr.setAlignment(Align.LEFT);
	this.hMdr.setDefaultValue(null);
	this.hMdr.setIconResource(null);
	this.hMdr.setWidth(50);
	this.hMdr.setOrder(10);

	this.hServiceFee.setColumnId("serviceFee");
	this.hServiceFee.setType(String.class);
	this.hServiceFee.setAlignment(Align.LEFT);
	this.hServiceFee.setDefaultValue(null);
	this.hServiceFee.setIconResource(null);
	this.hServiceFee.setWidth(50);
	this.hServiceFee.setOrder(11);

	this.hBankGuaranteeExpireDate.setColumnId("bankGuaranteeExpireDate");
	this.hBankGuaranteeExpireDate.setType(Date.class);
	this.hBankGuaranteeExpireDate.setFormatPattern(this.propertyBAO
		.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.format.monthYear"));
	this.hBankGuaranteeExpireDate.setAlignment(Align.CENTER);
	this.hBankGuaranteeExpireDate.setDefaultValue(null);
	this.hBankGuaranteeExpireDate.setIconResource(null);
	this.hBankGuaranteeExpireDate.setWidth(110);
	this.hBankGuaranteeExpireDate.setOrder(12);

	this.hLaunchedDate.setColumnId("launchedDate");
	this.hLaunchedDate.setType(Date.class);
	this.hLaunchedDate.setFormatPattern(this.propertyBAO
		.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.format.date"));
	this.hLaunchedDate.setAlignment(Align.CENTER);
	this.hLaunchedDate.setDefaultValue(null);
	this.hLaunchedDate.setIconResource(null);
	this.hLaunchedDate.setWidth(110);
	this.hLaunchedDate.setOrder(13);

	this.hStatus.setColumnId("status");
	this.hStatus.setType(String.class);
	this.hStatus.setAlignment(Align.CENTER);
	this.hStatus.setDefaultValue(null);
	this.hStatus.setIconResource(null);
	this.hStatus.setWidth(80);
	this.hStatus.setOrder(14);

	this.hCreateDate.setColumnId("createDate");
	this.hCreateDate.setType(String.class);
	this.hCreateDate.setAlignment(Align.CENTER);
	this.hCreateDate.setDefaultValue(null);
	this.hCreateDate.setIconResource(null);
	this.hCreateDate.setWidth(110);
	this.hCreateDate.setOrder(15);

	this.hLastUpdateDate.setColumnId("lastUpdateDate");
	this.hLastUpdateDate.setType(String.class);
	this.hLastUpdateDate.setAlignment(Align.CENTER);
	this.hLastUpdateDate.setDefaultValue(null);
	this.hLastUpdateDate.setIconResource(null);
	this.hLastUpdateDate.setWidth(110);
	this.hLastUpdateDate.setOrder(16);

	this.hCommand.setColumnId("commandLayout");
	this.hCommand.setType(HorizontalLayout.class);
	this.hCommand.setAlignment(Align.CENTER);
	this.hCommand.setDefaultValue(null);
	this.hCommand.setIconResource(null);
	this.hCommand.setWidth(140);
	this.hCommand.setOrder(17);

	List<TableHeaderProperty> headerProperties = new ArrayList<TableHeaderProperty>();
	headerProperties.add(hMerchantId);
	headerProperties.add(hMerchantName);
	headerProperties.add(hCompanyName);
	headerProperties.add(hMerchantServiceType);
	headerProperties.add(hMerchantUrl);
	headerProperties.add(hServiceId);
	headerProperties.add(hContactPerson);
	headerProperties.add(hHost);
	headerProperties.add(hServiceType);
	headerProperties.add(hMdr);
	headerProperties.add(hServiceFee);
	headerProperties.add(hBankGuaranteeExpireDate);
	headerProperties.add(hLaunchedDate);
	headerProperties.add(hStatus);
	headerProperties.add(hCreateDate);
	headerProperties.add(hLastUpdateDate);
	headerProperties.add(hCommand);

	this.tablePanel.setTableBeanContainerColumnHeader(headerProperties, SearchServiceProfileTableItemBean.class);
	this.tablePanel.setTableSelect(false);
	this.tablePanel.setAllowSortRecord(false);
	this.tablePanel.setEnableTableSorting(false);
	this.tablePanel.setTableColumnReordering(false);
	this.tablePanel.createControlTablePageNumber();
	this.tablePanel.setSortingTablePanel(this.sortingTablePanel);

	VerticalLayout mainLayout = new VerticalLayout();
	mainLayout.setSizeFull();
	mainLayout.setSizeUndefined();
	mainLayout.setSpacing(true);
	mainLayout.setWidth("100%");

	this.searchServiceProfilePanel.setContent(mainLayout);

	VerticalLayout formLayout = new VerticalLayout();
	formLayout.setId("formPanel");
	formLayout.setSizeUndefined();
	formLayout.setWidth("100%");
	formLayout.setSpacing(true);

	HorizontalLayout row0 = new HorizontalLayout();
	HorizontalLayout row1 = new HorizontalLayout();
	HorizontalLayout row2 = new HorizontalLayout();
	HorizontalLayout row3 = new HorizontalLayout();
	HorizontalLayout row4 = new HorizontalLayout();
	HorizontalLayout row5 = new HorizontalLayout();
	HorizontalLayout row6 = new HorizontalLayout();
	HorizontalLayout row7 = new HorizontalLayout();
	HorizontalLayout row8 = new HorizontalLayout();
	HorizontalLayout row9 = new HorizontalLayout();

	row1.setSpacing(true);
	row2.setSpacing(true);
	row3.setSpacing(true);
	row4.setSpacing(true);
	row5.setSpacing(true);
	row6.setSpacing(true);
	row7.setSpacing(true);
	row8.setSpacing(true);
	row9.setSpacing(true);

	row1.setSizeUndefined();
	row2.setSizeUndefined();
	row3.setSizeUndefined();
	row4.setSizeUndefined();
	row5.setSizeUndefined();
	row6.setSizeUndefined();
	row7.setSizeUndefined();
	row8.setSizeUndefined();
	row9.setSizeUndefined();

	HorizontalLayout row1Col1 = new HorizontalLayout();
	HorizontalLayout row1Sep1 = new HorizontalLayout();
	HorizontalLayout row1Col2 = new HorizontalLayout();
	HorizontalLayout row1Sep2 = new HorizontalLayout();
	HorizontalLayout row1Col3 = new HorizontalLayout();

	row1Col1.setSpacing(true);
	row1Col2.setSpacing(true);
	row1Col3.setSpacing(true);

	row1Sep1.setWidth("25px");
	row1Sep2.setWidth("25px");

	row1Col1.addComponent(lblServiceId);
	row1Col1.addComponent(cbbServiceId);
	row1Col2.addComponent(lblMerchantId);
	row1Col2.addComponent(cbbMerchantId);
	row1Col3.addComponent(lblMerchantName);
	row1Col3.addComponent(cbbMerchantName);

	row1Col1.setComponentAlignment(lblServiceId, Alignment.MIDDLE_LEFT);
	row1Col1.setComponentAlignment(cbbServiceId, Alignment.MIDDLE_LEFT);
	row1Col2.setComponentAlignment(lblMerchantId, Alignment.MIDDLE_LEFT);
	row1Col2.setComponentAlignment(cbbMerchantId, Alignment.MIDDLE_LEFT);
	row1Col3.setComponentAlignment(lblMerchantName, Alignment.MIDDLE_LEFT);
	row1Col3.setComponentAlignment(cbbMerchantName, Alignment.MIDDLE_LEFT);

	row1.addComponent(row1Col1);
	row1.addComponent(row1Sep1);
	row1.addComponent(row1Col2);
	row1.addComponent(row1Sep2);
	row1.addComponent(row1Col3);

	HorizontalLayout row2Col1 = new HorizontalLayout();
	HorizontalLayout row2Sep1 = new HorizontalLayout();
	HorizontalLayout row2Col2 = new HorizontalLayout();
	HorizontalLayout row2Sep2 = new HorizontalLayout();
	HorizontalLayout row2Col3 = new HorizontalLayout();

	row2Sep1.setWidth("25px");
	row2Sep2.setWidth("25px");

	row2Col1.setSpacing(true);
	row2Col2.setSpacing(true);
	row2Col3.setSpacing(true);

	row2Col1.addComponent(lblCompanyName);
	row2Col1.addComponent(cbbCompanyName);
	row2Col2.addComponent(lblProjectContact);
	row2Col2.addComponent(cbbProjectContact);
	row2Col3.addComponent(cbHideServiceTest);

	row2Col1.setComponentAlignment(lblCompanyName, Alignment.MIDDLE_LEFT);
	row2Col1.setComponentAlignment(cbbCompanyName, Alignment.MIDDLE_LEFT);
	row2Col2.setComponentAlignment(lblProjectContact, Alignment.MIDDLE_LEFT);
	row2Col2.setComponentAlignment(cbbProjectContact, Alignment.MIDDLE_LEFT);
	row2Col3.setComponentAlignment(cbHideServiceTest, Alignment.MIDDLE_LEFT);

	row2.addComponent(row2Col1);
	row2.addComponent(row2Sep1);
	row2.addComponent(row2Col2);
	row2.addComponent(row2Sep2);
	row2.addComponent(row2Col3);

	HorizontalLayout row3Col1 = new HorizontalLayout();
	HorizontalLayout row3Sep1 = new HorizontalLayout();
	HorizontalLayout row3Col2 = new HorizontalLayout();
	HorizontalLayout row3Sep2 = new HorizontalLayout();
	HorizontalLayout row3Col3 = new HorizontalLayout();

	row3Col1.setSpacing(true);
	row3Col2.setSpacing(true);
	row3Col3.setSpacing(true);

	row3Sep1.setWidth("25px");
	row3Sep2.setWidth("25px");

	row3Col1.addComponent(lblMdr);
	row3Col1.addComponent(cbbMdr);
	row3Col2.addComponent(lblServiceFee);
	row3Col2.addComponent(cbbServiceFee);
	row3Col3.addComponent(lblStatus);
	row3Col3.addComponent(cbbStatus);

	row3Col1.setComponentAlignment(lblMdr, Alignment.MIDDLE_LEFT);
	row3Col1.setComponentAlignment(cbbMdr, Alignment.MIDDLE_LEFT);
	row3Col2.setComponentAlignment(lblServiceFee, Alignment.MIDDLE_LEFT);
	row3Col2.setComponentAlignment(cbbServiceFee, Alignment.MIDDLE_LEFT);
	row3Col3.setComponentAlignment(lblStatus, Alignment.MIDDLE_LEFT);
	row3Col3.setComponentAlignment(cbbStatus, Alignment.MIDDLE_LEFT);

	row3.addComponent(row3Col1);
	row3.addComponent(row3Sep1);
	row3.addComponent(row3Col2);
	row3.addComponent(row3Sep2);
	row3.addComponent(row3Col3);

	HorizontalLayout row4Col1 = new HorizontalLayout();
	HorizontalLayout row4Sep1 = new HorizontalLayout();
	HorizontalLayout row4Col2 = new HorizontalLayout();

	row4Col1.setSpacing(true);
	row4Col2.setSpacing(true);

	row4Sep1.setWidth("25px");

	row4Col1.addComponent(lblServiceType);
	row4Col1.addComponent(cbbServiceType);
	row4Col2.addComponent(lblHost);
	row4Col2.addComponent(cbbHost);

	row4Col1.setComponentAlignment(lblServiceType, Alignment.MIDDLE_LEFT);
	row4Col1.setComponentAlignment(cbbServiceType, Alignment.MIDDLE_LEFT);
	row4Col2.setComponentAlignment(lblHost, Alignment.MIDDLE_LEFT);
	row4Col2.setComponentAlignment(cbbHost, Alignment.MIDDLE_LEFT);

	row4.addComponent(row4Col1);
	row4.addComponent(row4Sep1);
	row4.addComponent(row4Col2);

	HorizontalLayout row5Col1 = new HorizontalLayout();
	HorizontalLayout row5Sep1 = new HorizontalLayout();
	HorizontalLayout row5Col2 = new HorizontalLayout();
	HorizontalLayout row5Sep2 = new HorizontalLayout();
	HorizontalLayout row5Col3 = new HorizontalLayout();

	row5Col1.setSpacing(true);
	row5Col2.setSpacing(true);
	row5Col3.setSpacing(true);

	row5Sep1.setWidth("25px");
	row5Sep2.setWidth("25px");

	row5Col1.addComponent(lblBankGuaranteeExpireDate);
	row5Col2.addComponent(lblBankGuaranteeExpireDateFrom);
	row5Col2.addComponent(pdfBankGuaranteeExpireDateFrom);
	row5Col3.addComponent(lblBankGuaranteeExpireDateTo);
	row5Col3.addComponent(pdfBankGuaranteeExpireDateTo);

	row5Col1.setComponentAlignment(lblBankGuaranteeExpireDate, Alignment.MIDDLE_LEFT);
	row5Col2.setComponentAlignment(lblBankGuaranteeExpireDateFrom, Alignment.MIDDLE_LEFT);
	row5Col2.setComponentAlignment(pdfBankGuaranteeExpireDateFrom, Alignment.MIDDLE_LEFT);
	row5Col3.setComponentAlignment(lblBankGuaranteeExpireDateTo, Alignment.MIDDLE_LEFT);
	row5Col3.setComponentAlignment(pdfBankGuaranteeExpireDateTo, Alignment.MIDDLE_LEFT);

	row5.addComponent(row5Col1);
	row5.addComponent(row5Sep1);
	row5.addComponent(row5Col2);
	row5.addComponent(row5Sep2);
	row5.addComponent(row5Col3);

	HorizontalLayout row6Col1 = new HorizontalLayout();
	HorizontalLayout row6Sep1 = new HorizontalLayout();
	HorizontalLayout row6Col2 = new HorizontalLayout();
	HorizontalLayout row6Sep2 = new HorizontalLayout();
	HorizontalLayout row6Col3 = new HorizontalLayout();

	row6Col1.setSpacing(true);
	row6Col2.setSpacing(true);
	row6Col3.setSpacing(true);

	row6Sep1.setWidth("25px");
	row6Sep2.setWidth("25px");

	row6Col1.addComponent(lblLauchedDate);
	row6Col2.addComponent(lblLauchedDateFrom);
	row6Col2.addComponent(pdfLaunchedDateFrom);
	row6Col3.addComponent(lblLauchedDateTo);
	row6Col3.addComponent(pdfLaunchedDateTo);

	row6Col1.setComponentAlignment(lblLauchedDate, Alignment.MIDDLE_LEFT);
	row6Col2.setComponentAlignment(lblLauchedDateFrom, Alignment.MIDDLE_LEFT);
	row6Col2.setComponentAlignment(pdfLaunchedDateFrom, Alignment.MIDDLE_LEFT);
	row6Col3.setComponentAlignment(lblLauchedDateTo, Alignment.MIDDLE_LEFT);
	row6Col3.setComponentAlignment(pdfLaunchedDateTo, Alignment.MIDDLE_LEFT);

	row6.addComponent(row6Col1);
	row6.addComponent(row6Sep1);
	row6.addComponent(row6Col2);
	row6.addComponent(row6Sep2);
	row6.addComponent(row6Col3);

	row8.addComponent(btnSearch);
	row8.addComponent(btnNew);
	row8.addComponent(btnExport);
	row8.addComponent(btnClear);

	formLayout.addComponent(row0);
	formLayout.addComponent(row1);
	formLayout.addComponent(row2);
	formLayout.addComponent(row3);
	formLayout.addComponent(row4);
	formLayout.addComponent(row5);
	formLayout.addComponent(row6);
	formLayout.addComponent(row7);
	formLayout.addComponent(row8);
	formLayout.addComponent(row9);

	formLayout.setComponentAlignment(row1, Alignment.MIDDLE_CENTER);
	formLayout.setComponentAlignment(row2, Alignment.MIDDLE_CENTER);
	formLayout.setComponentAlignment(row3, Alignment.MIDDLE_CENTER);
	formLayout.setComponentAlignment(row4, Alignment.MIDDLE_CENTER);
	formLayout.setComponentAlignment(row5, Alignment.MIDDLE_CENTER);
	formLayout.setComponentAlignment(row6, Alignment.MIDDLE_CENTER);
	formLayout.setComponentAlignment(row7, Alignment.MIDDLE_CENTER);
	formLayout.setComponentAlignment(row8, Alignment.MIDDLE_CENTER);
	formLayout.setComponentAlignment(row9, Alignment.MIDDLE_CENTER);

	HorizontalLayout tableSortingLayout = new HorizontalLayout();
	tableSortingLayout.setSizeUndefined();
	tableSortingLayout.setWidth("99%");
	tableSortingLayout.addComponent(this.sortingTablePanel);

	HorizontalLayout tableLayout = new HorizontalLayout();
	tableLayout.setSizeUndefined();
	tableLayout.setWidth("99%");
	tableLayout.addComponent(this.tablePanel);

	mainLayout.addComponent(formLayout);
	mainLayout.addComponent(tableSortingLayout);
	mainLayout.addComponent(tableLayout);
	mainLayout.setExpandRatio(tableLayout, 1);

	mainLayout.setComponentAlignment(formLayout, Alignment.MIDDLE_CENTER);
	mainLayout.setComponentAlignment(tableSortingLayout, Alignment.MIDDLE_CENTER);
	mainLayout.setComponentAlignment(tableLayout, Alignment.MIDDLE_CENTER);

	this.addComponent(this.searchServiceProfilePanel);
	this.setComponentAlignment(this.searchServiceProfilePanel, Alignment.TOP_CENTER);

    }

    @Override
    public void initListener() {
	this.searchServiceProfileExportButtonClickListener.setBasedComponent(this);
	this.searchServiceProfileClearButtonClickListener.setBasedComponent(this);
	this.searchServiceProfileNewButtonClickListener.setBasedComponent(this);
	this.searchServiceProfileSearchButtonClickListener.setBasedComponent(this);
	this.searchServiceProfileTableDeleteButtonClickListener.setBasedComponent(this);
	this.searchServiceProfileTableEditButtonClickListener.setBasedComponent(this);
	this.searchServiceProfileTablePageButtonClickListener.setBasedComponent(this);
	this.searchServiceProfileTableSizeValueChangeListener.setBasedComponent(this);
	this.searchServiceProfileTableSortButtonClickListener.setBasedComponent(this);
	this.searchServiceProfileTableViewButtonClickListener.setBasedComponent(this);

	this.searchServiceProfileExportButtonClickListener.setAutoEnabled(true);
	this.searchServiceProfileExportButtonClickListener.setAutoEnabled(true);
	this.searchServiceProfileClearButtonClickListener.setAutoEnabled(true);
	this.searchServiceProfileNewButtonClickListener.setAutoEnabled(true);
	this.searchServiceProfileSearchButtonClickListener.setAutoEnabled(true);
	this.searchServiceProfileTableViewButtonClickListener.setAutoEnabled(true);
	this.searchServiceProfileTableDeleteButtonClickListener.setAutoEnabled(true);
	this.searchServiceProfileTableEditButtonClickListener.setAutoEnabled(true);

	this.searchServiceProfileTablePageButtonClickListener.setTablePanel(this.tablePanel);
	this.searchServiceProfileTableSizeValueChangeListener.setTablePanel(this.tablePanel);
	this.searchServiceProfileTableSortButtonClickListener.setTablePanel(this.tablePanel);

	this.tablePanel.addPageTableButtonClickListener(this.searchServiceProfileTablePageButtonClickListener);
	this.tablePanel.addSizeTableValueChangeListener(this.searchServiceProfileTableSizeValueChangeListener);
	this.sortingTablePanel.addSortTableButtonClickListener(this.searchServiceProfileTableSortButtonClickListener);

	this.btnSearch.addClickListener(this.searchServiceProfileSearchButtonClickListener);
	this.btnNew.addClickListener(this.searchServiceProfileNewButtonClickListener);
	this.btnExport.addClickListener(this.searchServiceProfileExportButtonClickListener);
	this.btnClear.addClickListener(this.searchServiceProfileClearButtonClickListener);

    }

    @Override
    public void initValidator() {
    }

    @SuppressWarnings("rawtypes")
    @Override
    public void initData() {
	try {
	    String hideServiceTestDefault = this.propertyBAO
		    .getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.default.hideServiceTest");
	    if (hideServiceTestDefault != null && !hideServiceTestDefault.isEmpty()) {
		cbHideServiceTest.setValue(new Boolean(hideServiceTestDefault));
	    } else {
		cbHideServiceTest.setValue(true);
	    }

	    String sortingDefault = this.propertyBAO
		    .getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.default.table.sorting");
	    String sortingItem = this.propertyBAO.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.table.sorting.item");
	    String sortingCaption = this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.table.sorting.caption");

	    if (sortingItem != null) {
		String[] sortingItemArr = sortingItem.split(",");
		String[] sortingCaptionArr = sortingCaption.split(",");
		if (sortingItemArr != null) {
		    for (int loop = 0; loop < sortingItemArr.length; loop++) {
			this.sortingTablePanel.addSortingItem(sortingItemArr[loop], sortingCaptionArr[loop]);
		    }
		}
	    }

	    String statusDefault = this.propertyBAO.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.default.status.item");
	    String statusInclude = this.propertyBAO.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.include.status.item");
	    String statusExclude = this.propertyBAO.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.exclude.status.item");
	    String statusIncludeCaption = this.messageBAO
		    .getMessage("com.fw.ui.view.profile.SearchServiceProfileView.include.status.item.caption");
	    if (statusInclude != null) {
		String[] statusIncludeArr = statusInclude.split(",");
		String[] statusIncludeCaptionArr = statusIncludeCaption.split(",");
		if (statusIncludeArr != null) {
		    for (int loop = 0; loop < statusIncludeArr.length; loop++) {
			this.cbbStatus.addItem(statusIncludeArr[loop]);
			this.cbbStatus.setItemCaption(statusIncludeArr[loop], statusIncludeCaptionArr[loop]);
		    }
		}
	    }
	    List<String> excludes = new ArrayList<String>();
	    if (statusExclude != null) {
		String[] statusExcludeArr = statusExclude.split(",");
		if (statusExcludeArr != null) {
		    for (int loop = 0; loop < statusExcludeArr.length; loop++) {
			excludes.add(statusExcludeArr[loop]);
		    }
		}
	    }
	    List<EntryBean<String, String>> userStatus = this.masterDataBAO.selectAllServiceProfileStatus();
	    if (userStatus != null) {
		for (EntryBean<String, String> entry : userStatus) {
		    this.statusMap.put(entry.getKey(), entry.getValue());
		    if (!excludes.contains(entry.getKey())) {
			this.cbbStatus.addItem(entry.getKey());
			this.cbbStatus.setItemCaption(entry.getKey(), entry.getValue());
		    }
		}
	    }
	    this.cbbStatus.select(statusDefault);
	    this.cbbStatus.setValue(statusDefault);

	    List<EntryBean<String, String>> serviceIds = this.masterDataBAO.selectAllServiceProfileServiceId();
	    if (serviceIds != null) {
		for (EntryBean<String, String> entry : serviceIds) {
		    if (entry.getValue() != null && entry.getValue().trim().length() > 0) {
			this.cbbServiceId.addItem(entry.getValue());
			this.cbbServiceId.setItemCaption(entry.getValue(), entry.getValue());
		    }
		}
	    }

	    List<EntryBean<String, String>> merchantIds = this.masterDataBAO.selectAllServiceProfileMerchantId();
	    if (merchantIds != null) {
		for (EntryBean<String, String> entry : merchantIds) {
		    if (entry.getValue() != null && entry.getValue().trim().length() > 0) {
			this.cbbMerchantId.addItem(entry.getValue());
			this.cbbMerchantId.setItemCaption(entry.getValue(), entry.getValue());
		    }
		}
	    }

	    List<EntryBean<String, String>> merchantNames = this.masterDataBAO.selectAllServiceProfileMerchantName();
	    if (merchantNames != null) {
		for (EntryBean<String, String> entry : merchantNames) {
		    if (entry.getValue() != null && entry.getValue().trim().length() > 0) {
			this.cbbMerchantName.addItem(entry.getValue());
			this.cbbMerchantName.setItemCaption(entry.getValue(), entry.getValue());
		    }
		}
	    }

	    List<EntryBean<String, String>> companyNames = this.masterDataBAO.selectAllServiceProfileCompanyName();
	    if (companyNames != null) {
		for (EntryBean<String, String> entry : companyNames) {
		    if (entry.getValue() != null && entry.getValue().trim().length() > 0) {
			this.cbbCompanyName.addItem(entry.getValue());
			this.cbbCompanyName.setItemCaption(entry.getValue(), entry.getValue());
		    }
		}
	    }

	    List<EntryBean<String, String>> projectContacts = this.masterDataBAO.selectAllServiceProfileProjectContact();
	    if (projectContacts != null) {
		for (EntryBean<String, String> entry : projectContacts) {
		    if (entry.getValue() != null && entry.getValue().trim().length() > 0) {
			this.cbbProjectContact.addItem(entry.getValue());
			this.cbbProjectContact.setItemCaption(entry.getValue(), entry.getValue());
		    }
		}
	    }

	    List<EntryBean<String, String>> mdrs = this.masterDataBAO.selectAllServiceProfileMdr();
	    if (mdrs != null) {
		for (EntryBean<String, String> entry : mdrs) {
		    if (entry.getValue() != null && entry.getValue().trim().length() > 0) {
			this.cbbMdr.addItem(entry.getValue());
			this.cbbMdr.setItemCaption(entry.getValue(), entry.getValue());
		    }
		}
	    }

	    List<EntryBean<String, String>> serviceFees = this.masterDataBAO.selectAllServiceProfileServiceFee();
	    if (serviceFees != null) {
		for (EntryBean<String, String> entry : serviceFees) {
		    if (entry.getValue() != null && entry.getValue().trim().length() > 0) {
			this.cbbServiceFee.addItem(entry.getValue());
			this.cbbServiceFee.setItemCaption(entry.getValue(), entry.getValue());
		    }
		}
	    }

	    String typeDefault = this.propertyBAO.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.default.type.item");
	    String typeInclude = this.propertyBAO.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.include.type.item");
	    String typeExclude = this.propertyBAO.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.exclude.type.item");
	    String typeIncludeCaption = this.messageBAO
		    .getMessage("com.fw.ui.view.profile.SearchServiceProfileView.include.type.item.caption");
	    if (typeInclude != null) {
		String[] statusIncludeArr = typeInclude.split(",");
		String[] statusIncludeCaptionArr = typeIncludeCaption.split(",");
		if (statusIncludeArr != null) {
		    for (int loop = 0; loop < statusIncludeArr.length; loop++) {
			this.cbbServiceType.addItem(statusIncludeArr[loop]);
			this.cbbServiceType.setItemCaption(statusIncludeArr[loop], statusIncludeCaptionArr[loop]);
		    }
		}
	    }
	    List<String> typeExcludes = new ArrayList<String>();
	    if (typeExclude != null) {
		String[] statusExcludeArr = typeExclude.split(",");
		if (statusExcludeArr != null) {
		    for (int loop = 0; loop < statusExcludeArr.length; loop++) {
			typeExcludes.add(statusExcludeArr[loop]);
		    }
		}
	    }
	    List<EntryBean<String, String>> serviceTypes = this.masterDataBAO.selectAllServiceProfilePaymentType();
	    if (serviceTypes != null) {
		for (EntryBean<String, String> entry : serviceTypes) {
		    if (entry.getValue() != null && entry.getValue().trim().length() > 0) {
			this.serviceTypeMap.put(entry.getKey(), entry.getValue());
			if (!typeExcludes.contains(entry.getKey())) {
			    this.cbbServiceType.addItem(entry.getKey());
			    this.cbbServiceType.setItemCaption(entry.getKey(), entry.getValue());
			}
		    }
		}
	    }
	    this.cbbServiceType.select(typeDefault);
	    this.cbbServiceType.setValue(typeDefault);

	    String hostDefault = this.propertyBAO.getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.default.host.item");
	    String hostCaption = this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.include.host.item.caption");
	    this.cbbHost.addItem(hostDefault);
	    this.cbbHost.setItemCaption(hostDefault, hostCaption);
	    List<EntryBean<String, String>> hosts = this.masterDataBAO.selectAllServiceProfileHost();
	    if (hosts != null) {
		for (EntryBean<String, String> entry : hosts) {
		    if (entry.getValue() != null && entry.getValue().trim().length() > 0) {
			this.cbbHost.addItem(entry.getKey());
			this.cbbHost.setItemCaption(entry.getKey(), entry.getValue());
		    }
		}
	    }
	    this.cbbHost.select(hostDefault);
	    this.cbbHost.setValue(hostDefault);

	    List<EntryBean<String, String>> merchantServiceTypes = this.masterDataBAO.selectAllMerchantProfileServiceType();
	    if (merchantServiceTypes != null) {
		for (EntryBean<String, String> entry : merchantServiceTypes) {
		    if (entry.getValue() != null && entry.getValue().trim().length() > 0) {
			this.merchantServiceTypeMap.put(entry.getKey(), entry.getValue());
		    }
		}
	    }

	    searchServiceProfileBean = new SearchServiceProfileBean();

	    searchServiceProfileBean.setServiceId((String) this.getCbbServiceId().getValue());
	    searchServiceProfileBean.setMerchantId((String) this.getCbbMerchantId().getValue());
	    searchServiceProfileBean.setMerchantName((String) this.getCbbMerchantName().getValue());
	    searchServiceProfileBean.setCompanyName((String) this.getCbbCompanyName().getValue());
	    searchServiceProfileBean.setProjectContact((String) this.getCbbProjectContact().getValue());
	    searchServiceProfileBean.setHideServiceTest((Boolean) this.getCbHideServiceTest().getValue());
	    searchServiceProfileBean.setBankGuaranteeExpireDateFrom(this.getPdfBankGuaranteeExpireDateFrom().getValue());
	    searchServiceProfileBean.setBankGuaranteeExpireDateTo(this.getPdfBankGuaranteeExpireDateTo().getValue());
	    searchServiceProfileBean.setLaunchedDateFrom(this.getPdfLaunchedDateFrom().getValue());
	    searchServiceProfileBean.setLaunchedDateTo(this.getPdfLaunchedDateTo().getValue());
	    searchServiceProfileBean.setMdr((String) this.getCbbMdr().getValue());
	    searchServiceProfileBean.setServiceFee((String) this.getCbbServiceFee().getValue());
	    searchServiceProfileBean.setHost((String) this.getCbbHost().getValue());
	    searchServiceProfileBean.setServiceType(((this.getCbbServiceType().getValue() == null
		    || this.getCbbServiceType().getValue().toString().trim().length() == 0 || this.getCbbServiceType().getValue()
		    .toString().trim().equals("0")) ? null : this.getCbbServiceType().getValue().toString()));
	    searchServiceProfileBean.setServiceStatus(((this.getCbbStatus().getValue() == null
		    || this.getCbbStatus().getValue().toString().trim().length() == 0 || this.getCbbStatus().getValue().toString().trim()
		    .equals("0")) ? null : this.getCbbStatus().getValue().toString()));

	    searchCriteriaBean.setDirection1(SearchCriteriaBean.DIRECTION_DESC);
	    searchCriteriaBean.setOrder1(sortingDefault);
	    searchCriteriaBean.setCriteriaBean(searchServiceProfileBean);
	    searchCriteriaBean.setPage(1);
	    searchCriteriaBean.setSize(30);
	    SearchResultBean<ServiceProfileBean> searchResultBean = serviceProfileBAO.selectServiceProfile(searchCriteriaBean);

	    Integer totalPage = searchResultBean.getTotalPages();
	    if (totalPage == null) {
		totalPage = 1;
	    }
	    Long totalElement = searchResultBean.getTotalElements();
	    if (totalElement == null) {
		totalElement = 0l;
	    }
	    List<BeanItem> beanItems = this.generateTableItemBean(searchResultBean);

	    this.tablePanel.clearTableData();
	    this.tablePanel.setManualPageTable(1);
	    this.tablePanel.setTableBeanContainerDataTotalPage(beanItems, totalPage, totalElement);
	} catch (Exception e) {
	    e.printStackTrace();
	}

    }

    @SuppressWarnings("rawtypes")
    public List<BeanItem> generateTableItemBean(SearchResultBean<ServiceProfileBean> searchResultBean) {
	List<BeanItem> beanItems = new ArrayList<BeanItem>();
	if (searchResultBean != null && searchResultBean.getContent() != null) {

	    this.tableViewButtons.clear();
	    this.tableEditButtons.clear();
	    this.tableDeleteButtons.clear();

	    DateFormat monthYearFormat = new SimpleDateFormat(StringUtils.PATTERN_MONTH_YEAR_PERSISTENCE);
	    DateFormat dateFormat = new SimpleDateFormat(StringUtils.PATTERN_DATE_PERSISTENCE);
	    DateFormat dateTimeFormat = new SimpleDateFormat(StringUtils.PATTERN_DATETIME_PERSISTENCE);
	    DateFormat monthYearFormatUI = new SimpleDateFormat(StringUtils.PATTERN_MONTH_YEAR_UI);
	    DateFormat dateFormatUI = new SimpleDateFormat(StringUtils.PATTERN_DATE_UI);
	    DateFormat dateTimeFormatUI = new SimpleDateFormat(StringUtils.PATTERN_DATETIME_UI);

	    String activeStatus = propertyBAO
		    .getPropertyValue("com.fw.ui.view.profile.SearchServiceProfileView.exclude.status.item.active");

	    for (int loop = 0; loop < searchResultBean.getContent().size(); loop++) {
		ServiceProfileBean serviceProfileBean = searchResultBean.getContent().get(loop);
		SearchServiceProfileTableItemBean searchServiceProfileTableItemBean = new SearchServiceProfileTableItemBean();
		searchServiceProfileTableItemBean.setId(serviceProfileBean.getId());

		searchServiceProfileTableItemBean.setMerchantId(serviceProfileBean.getMerchantId());
		searchServiceProfileTableItemBean.setMerchantName(serviceProfileBean.getMerchantNameEn());
		searchServiceProfileTableItemBean.setCompanyName(serviceProfileBean.getCompanyNameEn());
		String merchantServiceTypeText = this.merchantServiceTypeMap.get(serviceProfileBean.getMerchantServiceType());
		if (merchantServiceTypeText == null) {
		    merchantServiceTypeText = serviceProfileBean.getMerchantServiceType();
		}
		searchServiceProfileTableItemBean.setMerchantServiceType(merchantServiceTypeText);
		searchServiceProfileTableItemBean.setMerchantUrl(serviceProfileBean.getMerchantUrl());
		searchServiceProfileTableItemBean.setServiceId(serviceProfileBean.getServiceId());
		searchServiceProfileTableItemBean.setContactPerson(serviceProfileBean.getContact1Name());
		searchServiceProfileTableItemBean.setHost(serviceProfileBean.getHost());
		String serviceTypeText = this.serviceTypeMap.get(serviceProfileBean.getServiceType());
		if (serviceTypeText == null) {
		    serviceTypeText = serviceProfileBean.getServiceType();
		}
		searchServiceProfileTableItemBean.setServiceType(serviceTypeText);
		searchServiceProfileTableItemBean.setMdr(serviceProfileBean.getMdr());
		searchServiceProfileTableItemBean.setServiceFee(serviceProfileBean.getServiceFee());
		if (serviceProfileBean.getBankGuaranteeExpireDate() != null) {
		    try {
			Date date = monthYearFormat.parse(serviceProfileBean.getBankGuaranteeExpireDate());
			String strUI = monthYearFormatUI.format(date);
			searchServiceProfileTableItemBean.setBankGuaranteeExpireDate(strUI);
		    } catch (ParseException e) {
		    }
		}
		if (serviceProfileBean.getLaunchedDate() != null) {
		    try {
			Date date = dateFormat.parse(serviceProfileBean.getLaunchedDate());
			String strUI = dateFormatUI.format(date);
			searchServiceProfileTableItemBean.setLaunchedDate(strUI);
		    } catch (ParseException e) {
		    }
		}
		String statusText = this.statusMap.get(serviceProfileBean.getServiceStatus());
		if (statusText == null) {
		    statusText = serviceProfileBean.getServiceStatus();
		}
		searchServiceProfileTableItemBean.setStatus(statusText);

		if (serviceProfileBean.getCreateDate() != null) {
		    try {
			Date date = dateTimeFormat.parse(serviceProfileBean.getCreateDate());
			String strUI = dateTimeFormatUI.format(date);
			searchServiceProfileTableItemBean.setCreateDate(strUI);
		    } catch (ParseException e) {
		    }
		}
		if (serviceProfileBean.getLastUpdateDate() != null) {
		    try {
			Date date = dateTimeFormat.parse(serviceProfileBean.getLastUpdateDate());
			String strUI = dateTimeFormatUI.format(date);
			searchServiceProfileTableItemBean.setLastUpdateDate(strUI);
		    } catch (ParseException e) {
		    }
		}

		HorizontalLayout hLayout = new HorizontalLayout();
		Button btnView = new Button(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.button.table.view"));
		Button btnEdit = new Button(this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.button.table.edit"));
		Button btnDelete = new Button(
			this.messageBAO.getMessage("com.fw.ui.view.profile.SearchServiceProfileView.button.table.delete"));

		btnView.setData(serviceProfileBean);
		btnEdit.setData(serviceProfileBean);
		btnDelete.setData(serviceProfileBean);

		btnView.addClickListener(this.searchServiceProfileTableViewButtonClickListener);
		btnEdit.addClickListener(this.searchServiceProfileTableEditButtonClickListener);
		btnDelete.addClickListener(this.searchServiceProfileTableDeleteButtonClickListener);

		btnView.setDisableOnClick(true);
		btnEdit.setDisableOnClick(true);
		btnDelete.setDisableOnClick(true);

		btnView.addStyleName("button-green-small");
		btnEdit.addStyleName("button-blue-small");
		btnDelete.addStyleName("button-red-small");

		if (!activeStatus.equals(serviceProfileBean.getServiceStatus())) {
		    btnDelete.setEnabled(false);
		}

		tableViewButtons.add(btnView);
		tableEditButtons.add(btnEdit);
		tableDeleteButtons.add(btnDelete);

		hLayout.addComponent(btnView);
		hLayout.addComponent(new Label("&nbsp;", ContentMode.HTML));
		hLayout.addComponent(btnEdit);
		hLayout.addComponent(new Label("&nbsp;", ContentMode.HTML));
		hLayout.addComponent(btnDelete);

		searchServiceProfileTableItemBean.setCommandLayout(hLayout);

		beanItems.add(new BeanItem<SearchServiceProfileTableItemBean>(searchServiceProfileTableItemBean));
	    }
	}
	return beanItems;
    }

    public static long getSerialversionuid() {
	return serialVersionUID;
    }

    public VaadinApplicationObjectSupport getApp() {
	return app;
    }

    public MasterDataBAO getMasterDataBAO() {
	return masterDataBAO;
    }

    public MessageBAO getMessageBAO() {
	return messageBAO;
    }

    public PropertyBAO getPropertyBAO() {
	return propertyBAO;
    }

    public ServiceProfileBAO getServiceProfileBAO() {
	return serviceProfileBAO;
    }

    public Map<String, String> getStatusMap() {
	return statusMap;
    }

    public Map<String, String> getServiceTypeMap() {
	return serviceTypeMap;
    }

    public SearchServiceProfileBean getSearchServiceProfileBean() {
	return searchServiceProfileBean;
    }

    public SearchCriteriaBean<SearchServiceProfileBean> getSearchCriteriaBean() {
	return searchCriteriaBean;
    }

    public SearchServiceProfileClearButtonClickListener getSearchServiceProfileClearButtonClickListener() {
	return searchServiceProfileClearButtonClickListener;
    }

    public SearchServiceProfileNewButtonClickListener getSearchServiceProfileNewButtonClickListener() {
	return searchServiceProfileNewButtonClickListener;
    }

    public SearchServiceProfileSearchButtonClickListener getSearchServiceProfileSearchButtonClickListener() {
	return searchServiceProfileSearchButtonClickListener;
    }

    public SearchServiceProfileTableDeleteButtonClickListener getSearchServiceProfileTableDeleteButtonClickListener() {
	return searchServiceProfileTableDeleteButtonClickListener;
    }

    public SearchServiceProfileTableEditButtonClickListener getSearchServiceProfileTableEditButtonClickListener() {
	return searchServiceProfileTableEditButtonClickListener;
    }

    public SearchServiceProfileTablePageButtonClickListener getSearchServiceProfileTablePageButtonClickListener() {
	return searchServiceProfileTablePageButtonClickListener;
    }

    public SearchServiceProfileTableSizeValueChangeListener getSearchServiceProfileTableSizeValueChangeListener() {
	return searchServiceProfileTableSizeValueChangeListener;
    }

    public SearchServiceProfileTableSortButtonClickListener getSearchServiceProfileTableSortButtonClickListener() {
	return searchServiceProfileTableSortButtonClickListener;
    }

    public SearchServiceProfileTableViewButtonClickListener getSearchServiceProfileTableViewButtonClickListener() {
	return searchServiceProfileTableViewButtonClickListener;
    }

    public Panel getSearchServiceProfilePanel() {
	return searchServiceProfilePanel;
    }

    public TablePanel getTablePanel() {
	return tablePanel;
    }

    public SortingTablePanel getSortingTablePanel() {
	return sortingTablePanel;
    }

    public Label getLblServiceId() {
	return lblServiceId;
    }

    public Label getLblMerchantId() {
	return lblMerchantId;
    }

    public Label getLblMerchantName() {
	return lblMerchantName;
    }

    public Label getLblCompanyName() {
	return lblCompanyName;
    }

    public Label getLblProjectContact() {
	return lblProjectContact;
    }

    public Label getLblBankGuaranteeExpireDate() {
	return lblBankGuaranteeExpireDate;
    }

    public Label getLblBankGuaranteeExpireDateFrom() {
	return lblBankGuaranteeExpireDateFrom;
    }

    public Label getLblBankGuaranteeExpireDateTo() {
	return lblBankGuaranteeExpireDateTo;
    }

    public Label getLblLauchedDate() {
	return lblLauchedDate;
    }

    public Label getLblLauchedDateFrom() {
	return lblLauchedDateFrom;
    }

    public Label getLblLauchedDateTo() {
	return lblLauchedDateTo;
    }

    public Label getLblMdr() {
	return lblMdr;
    }

    public Label getLblServiceFee() {
	return lblServiceFee;
    }

    public Label getLblStatus() {
	return lblStatus;
    }

    public Label getLblServiceType() {
	return lblServiceType;
    }

    public Label getLblHost() {
	return lblHost;
    }

    public ComboBox getCbbServiceId() {
	return cbbServiceId;
    }

    public ComboBox getCbbMerchantId() {
	return cbbMerchantId;
    }

    public ComboBox getCbbMerchantName() {
	return cbbMerchantName;
    }

    public ComboBox getCbbCompanyName() {
	return cbbCompanyName;
    }

    public ComboBox getCbbProjectContact() {
	return cbbProjectContact;
    }

    public CheckBox getCbHideServiceTest() {
	return cbHideServiceTest;
    }

    public PopupDateField getPdfBankGuaranteeExpireDateFrom() {
	return pdfBankGuaranteeExpireDateFrom;
    }

    public PopupDateField getPdfBankGuaranteeExpireDateTo() {
	return pdfBankGuaranteeExpireDateTo;
    }

    public PopupDateField getPdfLaunchedDateFrom() {
	return pdfLaunchedDateFrom;
    }

    public PopupDateField getPdfLaunchedDateTo() {
	return pdfLaunchedDateTo;
    }

    public ComboBox getCbbMdr() {
	return cbbMdr;
    }

    public ComboBox getCbbServiceFee() {
	return cbbServiceFee;
    }

    public ComboBox getCbbStatus() {
	return cbbStatus;
    }

    public ComboBox getCbbServiceType() {
	return cbbServiceType;
    }

    public ComboBox getCbbHost() {
	return cbbHost;
    }

    public Button getBtnSearch() {
	return btnSearch;
    }

    public Button getBtnNew() {
	return btnNew;
    }

    public Button getBtnExport() {
	return btnExport;
    }

    public Button getBtnClear() {
	return btnClear;
    }

    public TableHeaderProperty gethServiceId() {
	return hServiceId;
    }

    public TableHeaderProperty gethMerchantId() {
	return hMerchantId;
    }

    public TableHeaderProperty gethMerchantName() {
	return hMerchantName;
    }

    public TableHeaderProperty gethContactPerson() {
	return hContactPerson;
    }

    public TableHeaderProperty gethHost() {
	return hHost;
    }

    public TableHeaderProperty gethServiceType() {
	return hMerchantServiceType;
    }

    public TableHeaderProperty gethBankGuaranteeExpireDate() {
	return hBankGuaranteeExpireDate;
    }

    public TableHeaderProperty gethStatus() {
	return hStatus;
    }

    public TableHeaderProperty gethCreateDate() {
	return hCreateDate;
    }

    public TableHeaderProperty gethLastUpdateDate() {
	return hLastUpdateDate;
    }

    public TableHeaderProperty gethCommand() {
	return hCommand;
    }

    public List<Button> getTableViewButtons() {
	return tableViewButtons;
    }

    public List<Button> getTableEditButtons() {
	return tableEditButtons;
    }

    public List<Button> getTableDeleteButtons() {
	return tableDeleteButtons;
    }

    public void setSearchCriteriaBean(SearchCriteriaBean<SearchServiceProfileBean> searchCriteriaBean) {
	this.searchCriteriaBean = searchCriteriaBean;
    }

    public SearchServiceProfileExportButtonClickListener getSearchServiceProfileExportButtonClickListener() {
	return searchServiceProfileExportButtonClickListener;
    }

    public static String getServiceTypeCash() {
	return SERVICE_TYPE_CASH;
    }

    public TableHeaderProperty gethCompanyName() {
	return hCompanyName;
    }

    public TableHeaderProperty gethMerchantServiceType() {
	return hMerchantServiceType;
    }

    public TableHeaderProperty gethMerchantUrl() {
	return hMerchantUrl;
    }

    public TableHeaderProperty gethMdr() {
	return hMdr;
    }

    public TableHeaderProperty gethServiceFee() {
	return hServiceFee;
    }

    public TableHeaderProperty gethLaunchedDate() {
	return hLaunchedDate;
    }

}
